package com.wt.admin.service.ai.impl;

import com.wt.admin.domain.dto.ai.KnowledgeTitleDTO;
import com.wt.admin.domain.vo.ai.KnowledgeTitleVO;
import com.wt.admin.service.ai.KnowledgeInfoService;
import com.wt.admin.service.ai.KnowledgeProxyService;
import com.wt.admin.service.ai.KnowledgeTitleService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
public class KnowledgeProxyServiceImpl implements KnowledgeProxyService {

    @Resource
    private KnowledgeInfoService knowledgeInfoService;
    @Resource
    private KnowledgeTitleService knowledgeTitleService;

    @Override
    public KnowledgeInfoService getKnowledgeInfoService() {
        return knowledgeInfoService;
    }

    @Override
    public KnowledgeTitleService getKnowledgeTitleService() {
        return knowledgeTitleService;
    }

    @Override
    public KnowledgeTitleVO titleDel(KnowledgeTitleDTO data) {
        knowledgeTitleService.titleDel(data.getId());
        knowledgeInfoService.titleDel(data.getId());
        return null;
    }

    public void init(){
        List<KnowledgeTitleVO> knowledgeTitleVOS = knowledgeTitleService.titleList(null);
        knowledgeInfoService.addFilesToMemory(knowledgeTitleVOS);
    }

}
